﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CardMonitor.Utils
{
    public class CardDeviceUtil
    {
        //移动IC至读卡位置
        public static void MoveCardToReadPosition()
        {
            PortControlHelper cardDeviceComm = App.getGlobalVariables().cardDeviceComm;
            if (null != cardDeviceComm && cardDeviceComm.PortState)
            {
                cardDeviceComm.SendHexData("F2 00 00 03 43 32 31 03 B2");
            }
        }
        //允许前端制卡
        public static void EndableFrontInCard()
        {
            PortControlHelper cardDeviceComm = App.getGlobalVariables().cardDeviceComm;
            if (null != cardDeviceComm && cardDeviceComm.PortState)
            {
                cardDeviceComm.SendHexData("F2 00 00 03 43 33 30 03 B2");
            }
        }
        //禁止前端制卡
        public static void DisableFrontInCard()
        {
            PortControlHelper cardDeviceComm = App.getGlobalVariables().cardDeviceComm;
            if (null != cardDeviceComm && cardDeviceComm.PortState)
            {
                cardDeviceComm.SendHexData("F2 00 00 03 43 33 31 03 B3");
            }
        }
        //弹出卡片
        public static void PopupCard()
        {
            PortControlHelper cardDeviceComm = App.getGlobalVariables().cardDeviceComm;
            if (null != cardDeviceComm && cardDeviceComm.PortState)
            {
                cardDeviceComm.SendHexData("F2 00 00 03 43 32 39 03 BA");
            }
        }
        //回收卡片
        public static void ReceiveCard()
        {
            PortControlHelper cardDeviceComm = App.getGlobalVariables().cardDeviceComm;
            if (null != cardDeviceComm && cardDeviceComm.PortState)
            {
                cardDeviceComm.SendHexData("F2 00 00 03 43 32 33 03 B0");
            }
        }
        public static void ceshi()
        {
            PortControlHelper cardDeviceComm = App.getGlobalVariables().cardDeviceComm;
            if (null != cardDeviceComm && cardDeviceComm.PortState)
            {
                cardDeviceComm.SendHexData("FFCC017A383130363138333730353233323030313033323732343135B6");
            }
        }
    }
}
